Skip to content

Conversation

@JosephSilber
Copy link
Contributor

@JosephSilber JosephSilber commented Dec 4, 2016

This enables stuff like:

Route::name('users.index')->middleware('auth')->get('users', function () {
    // some closure action...
});

...so that the calls to name and middleware are not hanging off the end of the closure.


Also, you can now use the middleware method with groups:

Route::middleware('auth')->prefix('api')->group(function () {
    // register some routes...
});

Finally, you can now register middleware for resources directly:

Route::middleware('auth')->resource('photo', 'PhotoController');

P.S. This has been previously attempted in #14354. Taking another stab at it here after talking it through with Taylor.

@taylorotwell taylorotwell merged commit 680b4d1 into laravel:master Dec 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants